<?php

namespace common\validate;


class Stage extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // Create
    public function sceneCreate()
    {
        return $this->append("data", "require|array")
            ->append("data.name", "require")
            ->append("data.type", "require|in:standard_meeting,standard_review,to_do")
            ->append('data.order_number', 'integer')
            ->append('data.step_category_id', 'require')
            ->append("data.ratio_list", "array")
            ->append("data.json", "array");
    }

    // Update
    public function sceneUpdate()
    {
        return $this->append("data", "require|array")
            ->append("data.id", "require|integer")
            ->append("data.type", "in:standard_meeting,standard_review,to_do")
            ->append('data.order_number', 'integer')
            ->append("data.ratio_list", "array")
            ->append("data.json", "array");
    }

    // Delete
    public function sceneDelete()
    {
        return $this->append("param", "require|array")
            ->append("param.stage_id_list", "require|array");
    }

    // List
    public function sceneList()
    {
        return $this->append("param.filter", "array")
            ->append("param.page", "array");
    }
}
